package com.kid.keep.pattern;


import cn.hutool.core.lang.Assert;
import com.kid.keep.po.CheckItemStandard;

/**
 * @Description 计算等级实现
 * @Author JOHN
 * @Create 2020-01-03
 * @Since 1.0.0
 */
public class ReportGradePattern extends AbstractReportGradePattern {

    private CheckItemStandard checkItemStandard;

    public ReportGradePattern(CheckItemStandard checkItemStandard) {
        this.checkItemStandard = checkItemStandard;
    }

    @Override
    public CheckItemStandard execute(Integer scope) {
        Assert.notNull(scope, "scope is null");
        CheckItemStandard reportGradeEnum = getGrade(this.checkItemStandard, scope);
        return execute(reportGradeEnum, scope);
    }
}
